package com.ruoyi.rocky.service.impl;


import com.ruoyi.common.core.domain.R;
import com.ruoyi.rocky.mapper.PcUserMapper;
import com.ruoyi.rocky.domain.PcUser;
import com.ruoyi.rocky.domain.PcUserUpdateBaseInfo;
import com.ruoyi.rocky.service.PcUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PcUserServiceImpl implements PcUserService {

    @Autowired
    private PcUserMapper userMapper;

    @Override
    public R<List<PcUser>> findAll() {
        List<PcUser> users = userMapper.sellAllUser();
        return R.ok(users);
    }

    @Override
    public R<Boolean> updateUser(PcUserUpdateBaseInfo userInfo) {
         userMapper.updateUserById(userInfo);
         return R.ok();
    }

    @Override
    public R deleteUser(Long id) {
         userMapper.deleteUserById(id);
         return R.ok();
    }
}
